<%@ page language="java" import="java.util.*,com.hs.auth.model.*,com.hs.nbspm.model.*,com.hs.core.utils.*" pageEncoding="utf-8"%>
<%
List datalist = (List)request.getAttribute("orglist"); 
String unitname = (String)request.getAttribute("unitname");
String flag = (String)request.getAttribute("flag"); 
 
 

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../../include.jsp"%>  
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>
 
<style>.tac{text-align:center}</style>
<script>
function searchData(){
  searchform.submit();
}

function selectUnits(){
    //var obj = document.getElementById("unitid");
    var unitselect = getRadioValue("unitid"); 
    if(typeof(unitselect) == "undefined"){
    	alert("请先选择单位！");
    	return;
    }  
    var docobj = window.opener.document;
      
     	docobj.getElementById("orgid").value=unitselect;
     	docobj.getElementById("orgname").value=document.getElementById("unitname_"+unitselect).value;
    	 
    
    window.close();
}
 
</script>
</head>
<body class="cont_body">
        
    <form name="searchform" action="<%=basePath %>auth/queryselectunit.do?flag=<%=flag %>" method="post"> 
       <table border="0" cellspacing="2" cellpadding="0" class="sear">
       <caption><font size=4>请在以下单位列表选择单位，点击确定按钮</font></caption>
    	<tr>
           <td width="10%">单位名称:</td>
           <td width="60%"><input type="hidden" name="flag" value="<%=flag==null?"":flag %>" />
           <input type="text" name="unitname" value="<%=unitname==null?"":unitname %>" style="width:80%"/></td>
           <td   align=center><input type="button" onclick="searchData();" value="查询" class="butt2"/></td>
           <td   align=center><input type="button" onclick="selectUnits();" value="确定" class="butt2"/></td> 
        </tr>  
     </table>   
        </form>
         <table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
         
          <tr> 
            <th width="20%">序号</th>
            <th width="80%">单位名称</th> 
          </tr>
          <%if(datalist != null && datalist.size()>0){  
			    for(int i =0;i<datalist.size();i++){ 
			    	Map obj = (Map)datalist.get(i);   
			    	String id = obj.get("id")+"";
 			%> 
   
			<tr> 
			<td align=center><input type="radio" value="<%=obj.get("id") %>" id="unitid" name="unitid"/>
			<input type="hidden" value="<%=obj.get("orgname")==null?"":obj.get("orgname")%>" id="unitname_<%=id %>" name="unitname_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("orgtype")==null?"":obj.get("orgtype")%>" id="orgtype_<%=id %>" name="orgtype_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("POSTADDRESS")==null?"":obj.get("POSTADDRESS")%>" id="postaddress_<%=id %>" name="postaddress_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("postnum")==null?"":obj.get("postnum")%>" id="postnum_<%=id %>" name="postnum_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("province")==null?"":obj.get("province")%>" id="province_<%=id %>" name="province_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("parentunit")==null?"":obj.get("parentunit")%>" id="parentunit_<%=id %>" name="parentunit_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("orgarea")==null?"":obj.get("orgarea")%>" id="orgarea_<%=id %>" name="orgarea_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("bankname")==null?"":obj.get("bankname")%>" id="bankname_<%=id %>" name="bankname_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("banknum")==null?"":obj.get("banknum")%>" id="banknum_<%=id %>" name="banknum_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("iscontry")==null?"":obj.get("iscontry")%>" id="iscontry_<%=id %>" name="iscontry_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("iszhongdian")==null?"":obj.get("iszhongdian")%>" id="iszhongdian_<%=id %>" name="iszhongdian_<%=id %>"/>
			<input type="hidden" value="<%=obj.get("orgcode")==null?"":obj.get("orgcode")%>" id="orgcode_<%=id %>" name="orgcode_<%=id %>"/>
			
			</td>
			<td align=center><%=StringUtilTool.NULL2Blank(obj.get("orgname")+"") %></td> 
			</tr> 
			<%}%>
			  
			<%}else{ %>
			<tr>
            <td colspan=2 align="center"><font color=red><strong>没有单位信息！</strong></font></td>
          </tr>
         
          <%} %>
          
        </table> 

</body>
</html>
